package com.vinjune.algorithm.concurrentDemo;

/**
 * Created by 835888 on 2015/11/16.
 */
public class ThreadDemo1 {

    public static class testThread1 extends Thread {

        public void run() {

            for (int i = 0; i < 100; i++) {
                System.out.println("test1:" + Thread.currentThread().getName() + ",i=" + i);
            }
        }
    }

    public static class testThread2 implements Runnable {


//        @Override
        public void run() {
            for (int i = 0; i < 100; i++) {
                System.out.println("test2:" + Thread.currentThread().getName() + ",i=" + i);
            }
        }
    }

    public static void main(String[] args){

        new testThread1().start();
        new Thread(new testThread2()).start();
        
        new Thread(new Runnable() {
//            @Override
            public void run() {
                for(int i=0;i<100;i++){
                    System.out.println("test3:"+Thread.currentThread().getName()+",i="+i);
                }
            }
        }).start();

    }
}
